package com.hlddz.venue_reservation.service.impl;

import com.hlddz.venue_reservation.dto.ReserveDetailDto;
import com.hlddz.venue_reservation.entity.Reserve;
import com.hlddz.venue_reservation.mapper.ReserveMapper;
import com.hlddz.venue_reservation.service.ReserveService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author MoShang
 * @since 2024年05月31日
 */
@Service
public class ReserveServiceImpl extends ServiceImpl<ReserveMapper, Reserve> implements ReserveService {


    @Resource
    private ReserveMapper reserveMapper;

    @Override
    public int doReserve(Reserve reserve) {
         reserveMapper.doReserve(reserve);
         return reserve.getReserveId();
    }

    @Override
    public List<Reserve> getReserves() {
        return reserveMapper.getReserves();
    }

    @Override
    public List<ReserveDetailDto> getReserveListByName(String username) {
        return reserveMapper.SelectReserveList(username);
    }

    @Override
    public void UpdateReserveStatus(int reserveId, String status) {
        reserveMapper.UpdateReserveStatus(reserveId,status);
    }
}
